class Params {
    constructor(code, msg, data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}

class ParamsFactory {
    static success(data) {
        return new Params(200, "Success", data);
    }
    static unauthorized(msg = "Unauthorized") {
        return new Params(401, msg, null);
    }
    static forbidden(msg = "Forbidden") {
        return new Params(403, msg, null);
    }
    static notFound(msg = "Not Found") {
        return new Params(404, msg, null);
    }
    static serverError(msg = "Internal Server Error") {
        return new Params(500, msg, null);
    }
}

module.exports = ParamsFactory;
